<%@page import="com.sun.xml.internal.txw2.Document"%>
<%@page import="java.text.Normalizer.Form"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>会员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9" />

<link href="css/login.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.9.0.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/WarnMessages.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.poshytip.js"></script>
<script type='text/javascript' src='js/jq.validate.js'></script>
<script type="text/javascript">
//异步获取登陆页面图片
$(function(){
	$.get("admin/findLoginImg", {adsIdStr:"1", value:"2"}, function(data) {
		data = jQuery.parseJSON(data);
		if(data.picSrc != "" || data.picSrc != null) {
			var html = "<img id='loginImg' width='547px' height='420px' src='" + data.picSrc + "' />";
			$(".middleimage").html(html);
		}
	});
});

function changeValidateCode(obj) {
	var timeNow = new Date().getTime();
	obj.src = "util/randomNum?time=" + timeNow;
}

function from1_1() {
	var input = document.getElementById("from1");
	if(input.value == "邮箱/用户名") {
		input.className = "from1_2";
		input.value = "";
	}
}

function from1_2() {
	var input = document.getElementById("from1");
	if("" == input.value) {
		input.className = "from1_1";
		input.value = "邮箱/用户名";
	}
}
/*****以下是表单验证****/
$(function(){
	
	$("#myform").validate({
	rules:{
			'company':{
			required:true
			},
			'editorChief.address':{
			required:true
			},
			'editorChief.businessId':{
			required:true
			},
			'businessImg':{
			required:true
			},
			'editorChief.codeId':{
			required:true
			},
			'codeImg':{
			required:true
			}
		}
	});
/*****以上是表单验证****/	          
    });
</script>
<!--验证  -->

<link rel="stylesheet" href="css/tip-yellowsimple.css" type="text/css" />

</head>
<body>
	<jsp:include page="top.jsp" />
	<div class="frame">
		<div class="middle">
			<!-- db部分开始-->
			<div id="bd">
				<!-- 登陆开始 -->
				<div class="form">
					<form  id="myform" action="/ejournal/user/userLogin" method="post" name="form">
						<table width="400px" height="290px" cellspacing="5px">
							
							 <tr height="45px" style="font-size:12px; color:red; text-align:center; vertical-align:bottom">
								<c:if test="${! empty requestScope.alert}">
								<td colspan="2">用户名，密码，验证码有错误。</td>
								</c:if>
							</tr>
							
							<tr height="55px">
								<td width="105px"><font color="#4B4B4C">账&nbsp;&nbsp;&nbsp;&nbsp;户：</font></td>
								<td width="280px">
									<input type="text" id="from1" class="from1_1" name="user.email" value="邮箱/用户名" onblur="from1_2()" onfocus="from1_1()" valType="required" msg="<font color=red>*</font>用户名不能为空" />
								</td>
							</tr>
							<tr height="55px">
								<td width="105px"><font color="#4B4B4C">密&nbsp;&nbsp;&nbsp;&nbsp;码：</font></td>
								<td><input type="password" name="user.password" class="from1" style="font-size:17px;" valType="required" msg="<font color=red>*</font>密码不能为空" />
								</td>
							</tr>
							<tr height="55px">
								<td width="105px"><font color="#4B4B4C">验证码：</font></td>
								<td width="105px">
									<div class="from23">
										<input type="text" name="random" id="random" class="from2" style="font-size:14px;" />
										<div class="from2-image">
											<img src="util/randomNum" onclick="changeValidateCode(this)" title="刷新验证码" style="cursor: hand;" align="middle" vertical-align="middle" />
										</div>
										<%-- <%=form.random.value==""?"请输入验证码":"" %> --%>
										<span style="color:red"></span>
									</div>
								</td>
							</tr>
							<tr align="top">
								<td></td>
								<td width="105px" height="55px">
									<div class="buttonall">
										<div class="button1" align="center">
											<input type="submit" value="登录" class="buttonOK" />
										</div>
										<div class="button1" align="right">
											<br />
											<a href="html/userFindPwd1.jsp"><font class="STYLE1">忘记密码</font></a>&nbsp;|&nbsp;
											<a href="html/userRegister.jsp"><font class="STYLE1">注册</font></a>
										</div>
									</div>
								</td>
							</tr>
						</table>
					</form>
				</div>
				<!-- 登录结束 -->
				<div class="middleimage"></div>
			</div>
			<!-- db部分结束-->
		</div>
	</div>
<jsp:include page="footer.jsp" />
</body>
</html>
